import axios from 'axios';
import yz from "m/comm/yz.js"  //验证模块
import ajax from "m/ajax/ajaxPost.js"  //验证模块
import Vue from 'vue'
import math from 'mathjs';
import dCompany from 'm/company/dCompany.js';
import address from "../../../models/dict/address"



export default {
    data() {
        return {





            addressOptions: address.address,
            selectedOptions: []
        }
    },
    methods: {
        getCompanyInfo: function (params) {


            this.selectedOptions = [this.currObj.address.provinceId, this.currObj.address.cityId, this.currObj.address.areaId]



        },

        saveCompany: function () {
            this.currObj.address = address.addressObj(this.selectedOptions, this.currObj.address.memo);
            this.currObj.addressArray = this.selectedOptions
            ajax.post({
                class: "company",
                para: "saveCompany",
                j: this.currObj,
                fun: (res) => {
                    if (!res.data.err) {
                        this.$message({

                            message: "提交成功!",
                            type: 'success'

                        });
                    }
                    else {
                        this.$message({
                            showClose: true,
                            message: res.data.err,
                            type: 'error'

                        });
                    }

                }
            })

        },
        picImgUp(a, b) {

            debugger
            Vue.set(this.currObj, "logoUrl", a.file.url)


        },


    },
    mounted() {

        this.getCompanyInfo();
    },
    props: {
        currObj: {}

        //    companyId: {}
    },
    components: {

    }
}
